//==============================================================================
//
//               Copyright (C) 2002  Dick van Oudheusden
//  
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along with this program; if not, write to the Free
// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
//==============================================================================
// 
//  $Date: 2003-10-31 08:12:36 $ $Revision: 1.1 $
//
//==============================================================================

#include <stdlib.h>

#include "ofc/config.h"

#include "ofc/DTimer.h"

#include "DInc.h"
#include "DTest.h"

//-Wrappers--------------------------------------------------------------------

void DTimer_test()
{
  DTimer *timer = [DTimer alloc];

  STARTTEST();

  [timer init :280];
  
  [DTimer delay :300];

  TEST([timer isExpired]);
  TEST([timer isExpired :10]);
  TEST(![timer isExpired :20]);

  [timer timeOut: 2000];
  [timer restart];
  while (![timer isExpired])
  {
    [DTimer delay :50];
  }

  [timer free];
  
  STOPTEST();
} 

